Main controller
Full Stick physics Full Stick's physics are based off of Unity's default physics, but with adjustments to tune the feel in better. The main physics controller currently adjusts 4 elements: * Mass * Drag * Angular Drag * Gravity Mass is the in-game mass (i.e. weight) of the quad in kg, typically around 0.56kg. Drag is the in-flight linear drag of the quad: higher values will create a more aggressive, grippy flight style, but the quad cannot be slung or "thrown" as far. Lower values will create more slippage on turns but allow for higher speeds and longer throws. Drag is highly sensitive, and is typically around 0.5. Angular drag is a force that counters rotation, when applied by physics. This is typically set high, usually around 45. Angular drag is taken into account when the quad collides midair with an object (without crashing). The amount of angular drag determines how off-axis the quad can be thrown from the collision (i.e. counters torque applied from collisions), and is mostly aesthetic. Finally, gravity is just in game gravity, usually tuned to allow realistic fall speeds with whatever mass has been set. To properly set this to it's real world counterpart, time how far it takes your quad to fall a certain distance, and adjust gravity until your quad falls at the same speed in-game. Full Stick input Full Stick does not use a fully simulated PID controller. If you want to fly a simulator, chances are you don't want the hassle of having to tune yet another set of PID's that don't act like they do in real life. Instead, Full Stick takes a slightly more "arcade" approach, sacrificing extreme physical modelling (which typically isn't very accurate) for a set of fully customizable controls that allow you to tune everything in to where it feels good. Full Stick ditches Unity's default input handling for it's own system, to allow customization on the fly. It applies it's own smoothing and deadzone to the input, the smoothing calculated by a MoveTowards function. This allows greater customization, and equates to the D setpoint weight and transition settings in BetaFlight. Rates Rates are controlled by a bezier calculation that takes into account the greatest number of degrees per second, the stick position, expo, and a special expo multiplier. Under the hood, the rates start as a linear interpolation between 0 and the max rate, controlled by the input. This is then fed into a quadratic bezier calculation: the "expo" value determines how close to 0 (between 0 and 0.5) the bezier's control point is located. Finally, if this expo is not strong enough, the expo multiplier takes the raw input and raises it to it's own power (input ^ expoMult). Additionally, since the bezier calculation cannot be calculated on a negative input, if the throttle stick returns a negative value, it's input is inverted in the calculation and the negative of the result used instead. The end result is that Full Stick's rates are absolute, not determined by your expo settings. So you can have a max rate of 1000 d/s capped, and be able to adjust your expo without having to retune your rates to account for the difference. Rotation, after the rates are calculated, is not applied directly as a change in rotation. Instead, it is applied as a spherical interpolation between current position and target position, with a very high interpolation rate. This rate can be changed as desired (rotSlerpSpeed), although it's default value of 10 is usually fine. Throttle Full Stick uses a slightly different approach to throttle from other sims. Instead of being a fixed force, Full Stick allows you to turn on a feature called NLT (non linear throttle), that roughly simulates airspeed of the quad and how that affects the force exerted by the propellors. Throttle is applied as a variable force along the vertical axis. The primary throttle value is the standard max force, but this is added to at local vertical velocities below the NLT (non linear throttle) breakpoint. The additional force is equal to NLT amount at a vertical velocity of zero, and equal to zero at a vertical velocity of NLT breakpoint. The additional force is linearly extrapolated for negative vertical velocities. The NLT breakpoint is limited to a max of around 50 m/s (180 kmh). The effect of NLT is to simulate airflow around the props. At higher velocities, air is approaching the props very quickly, effectively reducing thrust, or the amount the props can grip the air. However, at lower (or negative) velocities (falling), the airspeed relative to the props is zero or sometimes negative, giving the props even more grip. This is simulated by the NLT amount (amount of "grippiness") and NLT breakpoint (where the NLT effect tapers off). Collision Collision in Full Stick is divided into two categories: frame and propellor collisions. If crashes are enabled (aka non rubber egg mode), a collision will count as a crash (quad disabled) if the props hit an object while moving faster than the Prop Kill Speed or the frame hits an object while moving faster than Frame Kill Speed. This allows maneuvers like "doinking" and even landing properly, but a fast enough collision will still disable (read: destroy) the quad if the collision is hard enough to break the frame. Collisions below these speeds won't affect the quad at all (So there's no obnoxious prop damage like in Liftoff). This also emulates real life better, as even major prop injuries don't frequently affect flying characteristics much as long as the blades are still mostly intact. Additionally, Full Stick models relative collision speeds, not absolute. What this means is, it takes into account the force with which you actually hit the object, not just the speed of the quad at the moment of collision. This allows the pilot to slide and doink without breaking the frame, as it ensures that the evaluated collision force is the force along the surface normal of the object that was hit. In plain English, this allows you to grind rails, slide rooftops and steep edges, wall slide, and doink. Full Stick does model props and their collision individually, potentially allowing room for expansion (simulating the loss or partial loss of one prop, or informing the pilot which prop hit). When a collision is substantial enough to destroy the quad, the input is disabled (by setting a "crashed" flag), the quad's angular drag is set to 0 (to allow for more spinny and dramatic crashes), and the prop colliders are disabled (so after crash collision are more dramatic and somewhat more realistic). Then, after the number of seconds determined by the Respawn Time, the quad's position is set to it's spawn point, velocity is set to zero (in case the quad was moving while being reset), the angular drag is reset to the user set angular drag, and the prop colliders are re-enabled.